from openai import OpenAI

client = OpenAI(
        api_key="e1579e92-1838-48bf-b869-348a4bd1c214",  # 请替换成您的ModelScope SDK Token
        base_url="https://api-inference.modelscope.cn/v1/"
    )

response = client.chat.completions.create(
    model="Qwen/Qwen2.5-Coder-32B-Instruct",  # ModleScope Model-Id
    messages=[
        {
            'role': 'system',
            'content': 'You are a helpful assistant.'
        },
        {
            'role': 'user',
            'content': '用python写一下快排'
        }
    ],
    stream=False
)

print(response.choices[0].message.content)